package ch7;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Square {
    //长方形
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //1：w和h至少大于等于1
        System.out.println("请输入长方形的高和宽：");
        int w = 0;
        int h = 0;
        while (true) {
            w = in.nextInt();
            h = in.nextInt();
            if (w > 0 && h > 0) {
                break;
            }
            System.out.println("重来：");
        }
        //2:输出长方形：
        for (int i = 1; i <= h; i++) {
            for (int j = 1; j <= w; j++) {
                System.out.print("* ");
            }
            System.out.println();
        }
    }

}
